package com.luom.fsp.model.vo;

import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.luom.fsp.model.entity.Carousel;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 优惠券表视图
 *
*/
@Data
public class CarouselVO implements Serializable {

    /**
     * 轮播图ID
     */
    private Long id;

    /**
     * 图片地址
     */
    private String imageUrl;

    /**
     * 封装类转对象
     *
     * @param carouselVO
     * @return
     */
    public static Carousel voToObj(CarouselVO carouselVO) {
        if (carouselVO == null) {
            return null;
        }
        Carousel carousel = new Carousel();
        BeanUtils.copyProperties(carouselVO, carousel);
        return carousel;
    }

    /**
     * 对象转封装类
     *
     * @param carousel
     * @return
     */
    public static CarouselVO objToVo(Carousel carousel) {
        if (carousel == null) {
            return null;
        }
        CarouselVO carouselVO = new CarouselVO();
        BeanUtils.copyProperties(carousel, carouselVO);
        return carouselVO;
    }
}
